qui(
    function (require, exports, module) {
        Program.Action = (function () {
            // 表格
            var programListGrid = null;
            var programLibraryGrid = null;
            var editForm = null;
            // 节目单列表
            var listRun = function () {
                Ancestor.Config.EPG_AUTH.list = '/program/list';
                if (!programListGrid) {
                    programListGrid = new Program.Grid($.extend(true, {
                        // '$container': $('#ChannelListContainer'),
                        type: 0
                    }, {}));
                }
                programListGrid.runDayList();
                console.log('program grid run');
            }

            var libraryRun = function () {
                Ancestor.Config.EPG_AUTH.list = '/program/list';
                if (!programLibraryGrid) {
                    programLibraryGrid = new Program.Grid($.extend(true, {
                        '$container': $('#ProgramListContainer'),
                        $grid:$('#list'),
                        type: 0
                    }, {}));
                }
                programLibraryGrid.runLibrary();
                console.log('library grid run');
            }

          //  节目新建/编目
            var editRun = function () {
                if(editForm == null){
                    editForm = new Program.Edit($.extend(true, {
                        '$form': $('form[role=form]')
                    }, {}));
                    editForm.init();
                }
                console.log(' editRun ');
            }

            return {
                listRun: listRun,
                libraryRun: libraryRun,
                editRun:editRun
            }
        })();
    }
);